﻿using System;
using System.Text;
using Mono.Cecil.Metadata;
using Mono.Collections.Generic;

namespace Mono.Cecil
{
	// Token: 0x0200006C RID: 108
	public sealed class FunctionPointerType : TypeSpecification, IMethodSignature, IMetadataTokenProvider
	{
		// Token: 0x170000B5 RID: 181
		// (get) Token: 0x06000453 RID: 1107 RVA: 0x0001C020 File Offset: 0x0001A220
		// (set) Token: 0x06000454 RID: 1108 RVA: 0x00003B3A File Offset: 0x00001D3A
		public bool HasThis
		{
			get
			{
				return this.function.HasThis;
			}
			set
			{
				this.function.HasThis = value;
			}
		}

		// Token: 0x170000B6 RID: 182
		// (get) Token: 0x06000455 RID: 1109 RVA: 0x0001C040 File Offset: 0x0001A240
		// (set) Token: 0x06000456 RID: 1110 RVA: 0x00003B4A File Offset: 0x00001D4A
		public bool ExplicitThis
		{
			get
			{
				return this.function.ExplicitThis;
			}
			set
			{
				this.function.ExplicitThis = value;
			}
		}

		// Token: 0x170000B7 RID: 183
		// (get) Token: 0x06000457 RID: 1111 RVA: 0x0001C060 File Offset: 0x0001A260
		// (set) Token: 0x06000458 RID: 1112 RVA: 0x00003B5A File Offset: 0x00001D5A
		public MethodCallingConvention CallingConvention
		{
			get
			{
				return this.function.CallingConvention;
			}
			set
			{
				this.function.CallingConvention = value;
			}
		}

		// Token: 0x170000B8 RID: 184
		// (get) Token: 0x06000459 RID: 1113 RVA: 0x0001C080 File Offset: 0x0001A280
		public bool HasParameters
		{
			get
			{
				return this.function.HasParameters;
			}
		}

		// Token: 0x170000B9 RID: 185
		// (get) Token: 0x0600045A RID: 1114 RVA: 0x0001C0A0 File Offset: 0x0001A2A0
		public Collection<ParameterDefinition> Parameters
		{
			get
			{
				return this.function.Parameters;
			}
		}

		// Token: 0x170000BA RID: 186
		// (get) Token: 0x0600045B RID: 1115 RVA: 0x0001C0C0 File Offset: 0x0001A2C0
		// (set) Token: 0x0600045C RID: 1116 RVA: 0x00003B6A File Offset: 0x00001D6A
		public TypeReference ReturnType
		{
			get
			{
				return this.function.MethodReturnType.ReturnType;
			}
			set
			{
				this.function.MethodReturnType.ReturnType = value;
			}
		}

		// Token: 0x170000BB RID: 187
		// (get) Token: 0x0600045D RID: 1117 RVA: 0x0001C0E4 File Offset: 0x0001A2E4
		public MethodReturnType MethodReturnType
		{
			get
			{
				return this.function.MethodReturnType;
			}
		}

		// Token: 0x170000BC RID: 188
		// (get) Token: 0x0600045E RID: 1118 RVA: 0x0001C104 File Offset: 0x0001A304
		// (set) Token: 0x0600045F RID: 1119 RVA: 0x00002AA0 File Offset: 0x00000CA0
		public override string Name
		{
			get
			{
				return this.function.Name;
			}
			set
			{
				throw new InvalidOperationException();
			}
		}

		// Token: 0x170000BD RID: 189
		// (get) Token: 0x06000460 RID: 1120 RVA: 0x0001A928 File Offset: 0x00018B28
		// (set) Token: 0x06000461 RID: 1121 RVA: 0x00002AA0 File Offset: 0x00000CA0
		public override string Namespace
		{
			get
			{
				return string.Empty;
			}
			set
			{
				throw new InvalidOperationException();
			}
		}

		// Token: 0x170000BE RID: 190
		// (get) Token: 0x06000462 RID: 1122 RVA: 0x0001C124 File Offset: 0x0001A324
		public override ModuleDefinition Module
		{
			get
			{
				return this.ReturnType.Module;
			}
		}

		// Token: 0x170000BF RID: 191
		// (get) Token: 0x06000463 RID: 1123 RVA: 0x0001C144 File Offset: 0x0001A344
		// (set) Token: 0x06000464 RID: 1124 RVA: 0x00002AA0 File Offset: 0x00000CA0
		public override IMetadataScope Scope
		{
			get
			{
				return this.function.ReturnType.Scope;
			}
			set
			{
				throw new InvalidOperationException();
			}
		}

		// Token: 0x170000C0 RID: 192
		// (get) Token: 0x06000465 RID: 1125 RVA: 0x0000A3A0 File Offset: 0x000085A0
		public override bool IsFunctionPointer
		{
			get
			{
				return true;
			}
		}

		// Token: 0x170000C1 RID: 193
		// (get) Token: 0x06000466 RID: 1126 RVA: 0x0001C168 File Offset: 0x0001A368
		public override bool ContainsGenericParameter
		{
			get
			{
				return this.function.ContainsGenericParameter;
			}
		}

		// Token: 0x170000C2 RID: 194
		// (get) Token: 0x06000467 RID: 1127 RVA: 0x0001C188 File Offset: 0x0001A388
		public override string FullName
		{
			get
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(this.function.Name);
				stringBuilder.Append(" ");
				stringBuilder.Append(this.function.ReturnType.FullName);
				stringBuilder.Append(" *");
				this.MethodSignatureFullName(stringBuilder);
				return stringBuilder.ToString();
			}
		}

		// Token: 0x06000468 RID: 1128 RVA: 0x00003B7F File Offset: 0x00001D7F
		public FunctionPointerType() : base(null)
		{
			this.function = new MethodReference();
			this.function.Name = "method";
			this.etype = Mono.Cecil.Metadata.ElementType.FnPtr;
		}

		// Token: 0x06000469 RID: 1129 RVA: 0x0001C1F0 File Offset: 0x0001A3F0
		public override TypeDefinition Resolve()
		{
			return null;
		}

		// Token: 0x0600046A RID: 1130 RVA: 0x0001C204 File Offset: 0x0001A404
		public override TypeReference GetElementType()
		{
			return this;
		}

		// Token: 0x04000120 RID: 288
		private readonly MethodReference function;
	}
}
